<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Transition</title>
    <style type="text/css">
        #div01 {
            width: 500px;
            height: 200px;
            background-color: yellowgreen;

            border: 2px solid brown;

            transition: width 2s;
        }

        #div01:hover {
            width: 300px;
        }
    </style>
</head>
<body>
<div id="div01"></div>
</body>
</html>